//
//  STDoorEvaCell.m
//  YiYueHairdresser
//
//  Created by zhouzhouzhou on 2018/10/10.
//  Copyright © 2018年 YuYiLian. All rights reserved.
//

#import "STDoorEvaCell.h"

#import "AnotherStarEvaluator.h"
@implementation STDoorEvaCell


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    self = [[[NSBundle mainBundle] loadNibNamed:@"STDoorEvaCell" owner:nil options:nil] lastObject];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    return self;
}

-(void)setEvaluateView:(id)data{
    AnotherStarEvaluator *starAllEva = [[AnotherStarEvaluator alloc] initWithFrame:CGRectMake(0,(self.starBackView.frame.size.height-20)/2, 100, 20)];
    //    starAllEva.delegate = self;
    starAllEva.enabled=NO;
    [self.starBackView addSubview:starAllEva];
    if([data isKindOfClass:[STDoorCommonModel class]]){
        STDoorCommonModel * model = data;
        if(model.score){
            [starAllEva setCurrentValue:model.score];
        }else if(model.comprehensive){
            [starAllEva setCurrentValue:model.comprehensive];
        }
        
        [self.commentBtn setTitle:[NSString stringWithFormat:@"查看所有评论%ld",model.scoreCount] forState:UIControlStateNormal];
        self.evaLab1.text = [NSString stringWithFormat:@"专业技能:%0.1f",model.skill];
        self.evaLab2.text = [NSString stringWithFormat:@"服务态度:%0.1f",model.server];
        self.evaLab3.text = [NSString stringWithFormat:@"洗发体验:4.5"];
    }else if([data isKindOfClass:[STHairDetailInfoModel class]]){
        STHairDetailInfoModel * detailModel = data;
        [starAllEva setCurrentValue:detailModel.star];
        [self.commentBtn setTitle:[NSString stringWithFormat:@"查看所有评论%d",detailModel.scoreCount] forState:UIControlStateNormal];
    }else{
         [starAllEva setCurrentValue:0];
    }
    [self.commentBtn setColor:[UIColor orangeColor]];
    
}

- (IBAction)actionSeeAllComment:(id)sender {
}


@end
